home *** CD-ROM | disk | FTP | other *** search
/ Just Call Me Internet / Just Call Me Internet.iso / prog / atari / c / du_lib / stdkey.c < prev    next >
C/C++ Source or Header  |  1995-07-10  |  1KB  |  48 lines

  1. /*
  2.   DU_LIB v2
  3.   Gem Window Management & Dialog Library For Lattice C
  4.   ½1994, by Craig Graham.
  5.   
  6.   Based on the DU_LIBv1 Library for HiSoft Basic.
  7. */
  8.  
  9. /*
  10.     Standard Keyboard Shortcut Handler
  11. */
  12.  
  13. #include "DULIB.H"
  14.  
  15. /*
  16.     This uses the Application global layer keyboard handler to define some
  17.     of the standard keyboard shortcuts used by most modern GEM programs.
  18.     These work mostly by sending an AES message to ourself to get the desired
  19.     effect.
  20. */
  21. void Set_standard_keyboard(void)
  22. {
  23.     Set_key_callback(0x1615, &std_key_close_window);
  24.     Set_key_callback(0x1117, &std_key_cycle_window);
  25. }
  26.  
  27. /* Close the top window */
  28. short std_key_close_window(void)
  29. {
  30.     short a;
  31.     
  32.     wind_get(0,WF_TOP,&a,0,0,0);
  33.     if (windows[a].window_type!=wt_null)
  34.         I_send_message(a, WM_CLOSED);
  35.     return TRUE;
  36. }
  37.  
  38. /* Send top window to the bottom */
  39. short std_key_cycle_window(void)
  40. {
  41.     short a;
  42.     
  43.     wind_get(0,WF_TOP,&a,0,0,0);
  44.     if (windows[a].window_type!=wt_null)
  45.         I_send_message(a, WM_BOTTOMED);
  46.     return TRUE;
  47. }
  48.